<?php
use yii\bootstrap\Nav;
use dmstr\widgets\Menu;
/**
 * Created by PhpStorm.
 * User: shan
 * Date: 2016/11/17
 * Time: 13:24
 */

//echo Nav::widget([
//    'options' => [
//        'class' => 'sidebar-menu'
//    ],
//    'items' => [
//        [
//            'label' => Yii::t('app', '首页'),
//            'url' => Yii::$app->homeUrl,
//            'icon' => 'fa-home',
//            'active' => Yii::$app->request->url === Yii::$app->homeUrl,
//        ],
//        [
//            'label' => Yii::t('app', '停车场管理'),
//            'url' => ['/parklot/index'],
//            'icon' => 'fa fa-truck',
//        ],
//        ],
//]);
echo dmstr\widgets\Menu::widget(
    [
        'options' => ['class' => 'sidebar-menu'],
        'items' => [
            ['label' => 'Menu Yii2', 'options' => ['class' => 'header']],
            ['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest],
            [
                'label' => '调试工具',
                'icon' => 'fa fa-share',
                'url' => '#',
                'items' => [
                    ['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii'],],
                    ['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug'],],
//                    [
//                        'label' => 'Level One',
//                        'icon' => 'fa fa-circle-o',
//                        'url' => '#',
//                        'items' => [
//                            ['label' => 'Level Two', 'icon' => 'fa fa-circle-o', 'url' => '#',],
//                            [
//                                'label' => 'Level Two',
//                                'icon' => 'fa fa-circle-o',
//                                'url' => '#',
//                                'items' => [
//                                    ['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',],
//                                    ['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',],
//                                ],
//                            ],
//                        ],
//                    ],
                ],
            ],
            [
            'label' => Yii::t('app', '首页'),
            'url' => ['/site/index'],
            'icon' => 'fa fa-home',
            ],
            [
            'label' => Yii::t('app', '轮播图'),
            'url' => ['/banner/index'],
            'icon' => 'fa fa-files-o',
            ],
            [
            'label' => Yii::t('app', '管理员'),
            'url' => ['#'],
            'items' => [
                [
                    'label' => '权限',
                    'icon' => 'fa fa-circle-o',
                    'url' => '#',
                    'items' => [
                        [
                            'label' => '路由',
                            'icon' => 'fa fa-circle-o',
                            'url' => ['/admin/route'],
                        ],
                        [
                            'label' => '权限',
                            'icon' => 'fa fa-circle-o',
                            'url' => ['/admin/permission'],
                        ],
                        [
                            'label' => '角色',
                            'icon' => 'fa fa-circle-o',
                            'url' => ['/admin/role'],
                        ],
                        [
                            'label' => '分配',
                            'icon' => 'fa fa-circle-o',
                            'url' => ['/admin/assignment'],
                        ],
                        [
                            'label' => '菜单',
                            'icon' => 'fa fa-circle-o',
                            'url' => ['/admin/menu'],
                        ],
                    ],
                ],
                ]
            ],

        ],
    ]);
